home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / librw / RWCSubString.z / RWCSubString
Encoding:
Text File  |  1998-10-30  |  11.5 KB  |  265 lines

  1.  
  2.  
  3.  
  4. RRRRWWWWCCCCSSSSuuuubbbbSSSSttttrrrriiiinnnngggg((((3333CCCC++++++++))))                                          RRRRWWWWCCCCSSSSuuuubbbbSSSSttttrrrriiiinnnngggg((((3333CCCC++++++++))))
  5.  
  6.  
  7.  
  8. NNNNaaaammmmeeee
  9.      RWCSubString - Rogue Wave library class
  10.  
  11. SSSSyyyynnnnooooppppssssiiiissss
  12.               #include <rw/cstring.h>
  13.  
  14.  
  15.  
  16.               RWCString s("test string");
  17.           s(6,3);     // "tri"
  18.  
  19.  
  20.  
  21.  
  22. DDDDeeeessssccccrrrriiiippppttttiiiioooonnnn
  23.      The class RRRRWWWWCCCCSSSSuuuubbbbSSSSttttrrrriiiinnnngggg allows some subsection of an RRRRWWWWCCCCSSSSttttrrrriiiinnnngggg to be
  24.      addressed by defining a ssssttttaaaarrrrttttiiiinnnngggg ppppoooossssiiiittttiiiioooonnnn and an eeeexxxxtttteeeennnntttt.  For example the
  25.      7th through the 11th elements, inclusive, would have a starting position
  26.      of 7 and an extent of 5.  The specification of a starting position and
  27.      extent can also be done in your behalf by such functions as
  28.      RRRRWWWWCCCCSSSSttttrrrriiiinnnngggg::::::::ssssttttrrrriiiipppp(((()))) or the overloaded function call operator taking a
  29.      regular expression as an argument.  There are no public constructors --
  30.      RRRRWWWWCCCCSSSSuuuubbbbSSSSttttrrrriiiinnnnggggs are constructed by various functions of the RRRRWWWWCCCCSSSSttttrrrriiiinnnngggg class
  31.      and then destroyed immediately. A zzzzeeeerrrroooo lllleeeennnnggggtttthhhh substring is one with a
  32.      defined starting position and an extent of zero.  It can be thought of as
  33.      starting just before the indicated character, but not including it.  It
  34.      can be used as an lvalue.  A null substring is also legal and is
  35.      frequently used to indicate that a requested substring, perhaps through a
  36.      search, does not exist.  A null substring can be detected with member
  37.      function iiiissssNNNNuuuullllllll(((())))....  However, it cannot be used as an lvalue.
  38.  
  39. PPPPeeeerrrrssssiiiisssstttteeeennnncccceeee
  40.      None
  41.  
  42. EEEExxxxaaaammmmpppplllleeee
  43.               #include <rw/cstring.h>
  44.           #include <rw/rstream.h>
  45.           main(){
  46.             RWCString s("What I tell you is true.");
  47.             // Create a substring and use it as an lvalue:
  48.             s(19, 0) = "three times ";
  49.             cout << s << endl;
  50.           }
  51.  
  52.  
  53.      PPPPrrrrooooggggrrrraaaammmm oooouuuuttttppppuuuutttt::::
  54.  
  55.               What I tell you is three times true.
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. RRRRWWWWCCCCSSSSuuuubbbbSSSSttttrrrriiiinnnngggg((((3333CCCC++++++++))))                                          RRRRWWWWCCCCSSSSuuuubbbbSSSSttttrrrriiiinnnngggg((((3333CCCC++++++++))))
  71.  
  72.  
  73.  
  74.  
  75.  
  76. AAAAssssssssiiiiggggnnnnmmmmeeeennnntttt OOOOppppeeeerrrraaaattttoooorrrrssss
  77.               RWCSubString&
  78.           ooooppppeeeerrrraaaattttoooorrrr====(const RWCString&);
  79.  
  80.  
  81.      Assignment from an RRRRWWWWCCCCSSSSttttrrrriiiinnnngggg.  The statements:
  82.  
  83.               RWCString a;
  84.  
  85.  
  86.  
  87.               RWCString b;
  88.           b(2, 3) = a;
  89.  
  90.  
  91.      will copy aaaa's data into the substring bbbb((((2222,,,,3333)))).  The number of elements
  92.      need not match: if they differ, bbbb will be resized appropriately.  Sets
  93.      self's extent to be the length of the assigned RRRRWWWWCCCCSSSSttttrrrriiiinnnngggg....  If self is the
  94.      null substring, then the statement has no effect.  Returns a reference to
  95.      self.
  96.  
  97.               RWCSubString&
  98.           ooooppppeeeerrrraaaattttoooorrrr====(const RWCSubString&);
  99.  
  100.  
  101.      Assignment from an RRRRWWWWCCCCSSSSuuuubbbbSSSSttttrrrriiiinnnngggg.  The statements:
  102.  
  103.               RWCString a;
  104.  
  105.  
  106.  
  107.               RWCString b;
  108.           b(2, 3) = a(5,5);
  109.  
  110.  
  111.      will copy 5 characters of aaaa's data into the substring bbbb((((2222,,,,3333)))).  The number
  112.      of elements need not match: if they differ, bbbb will be resized
  113.      appropriately.  Sets self's extent to be the extent of the assigned
  114.      RRRRWWWWCCCCSSSSuuuubbbbSSSSttttrrrriiiinnnngggg.  If self is the null substring, then the statement has no
  115.      effect.  Returns a reference to self.
  116.  
  117.               RWCSubString&
  118.           ooooppppeeeerrrraaaattttoooorrrr====(const char*);
  119.  
  120.  
  121.      Assignment from a character string.  Example:
  122.  
  123.               RWCString str("Mary had a lamb");
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. RRRRWWWWCCCCSSSSuuuubbbbSSSSttttrrrriiiinnnngggg((((3333CCCC++++++++))))                                          RRRRWWWWCCCCSSSSuuuubbbbSSSSttttrrrriiiinnnngggg((((3333CCCC++++++++))))
  137.  
  138.  
  139.  
  140.               char dat[] = "Perrier";
  141.           str(11,4) = dat;  // "Mary had a Perrier"
  142.  
  143.  
  144.      Note that the number of characters selected need not match: if they
  145.      differ, ssssttttrrrr will be resized appropriately.  Sets self's extent to be the
  146.      ssssttttrrrrlllleeeennnn(((()))) of the assigned character string.  If self is the null
  147.      substring, then the statement has no effect.  Returns a reference to
  148.      self.
  149.  
  150. IIIInnnnddddeeeexxxxiiiinnnngggg OOOOppppeeeerrrraaaattttoooorrrrssss
  151.               char&
  152.           ooooppppeeeerrrraaaattttoooorrrr[[[[]]]](size_t i);
  153.           char
  154.           ooooppppeeeerrrraaaattttoooorrrr[[[[]]]](size_t i) const;
  155.  
  156.  
  157.      Returns the iiiith character of the substring.  The first variant can be
  158.      used as an lvalue, the second cannot.  The index iiii must be between zero
  159.      and the length of the substring, less one.  Bounds checking is performed:
  160.      if the index is out of range, then an exception of type RRRRWWWWBBBBoooouuuunnnnddddssssEEEErrrrrrrr will
  161.      occur.
  162.  
  163.               char&
  164.           ooooppppeeeerrrraaaattttoooorrrr(((())))(size_t i);
  165.           char
  166.           ooooppppeeeerrrraaaattttoooorrrr(((())))(size_t i) const;
  167.  
  168.  
  169.      Returns the iiiith character of the substring.  The first variant can be
  170.      used as an lvalue, the second cannot.  The index iiii must be between zero
  171.      and the length of the substring, less one.  Bounds checking is enabled by
  172.      defining the pre-processor macro RRRRWWWWBBBBOOOOUUUUNNNNDDDDSSSS____CCCCHHHHEEEECCCCKKKK before including
  173.      <<<<rrrrwwww////ccccssssttttrrrriiiinnnngggg....hhhh>>>>.  In this case, if the index is out of range, then an
  174.      exception of type RRRRWWWWBBBBoooouuuunnnnddddssssEEEErrrrrrrr will occur.
  175.  
  176. PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr FFFFuuuunnnnccccttttiiiioooonnnnssss
  177.               RWBoolean
  178.           iiiissssNNNNuuuullllllll() const;
  179.  
  180.  
  181.      Returns TTTTRRRRUUUUEEEE if this is a null substring.
  182.  
  183.               size_t
  184.           lllleeeennnnggggtttthhhh() const;
  185.  
  186.  
  187.      Returns the extent (iiii....eeee...., length) of the RRRRWWWWCCCCSSSSuuuubbbbSSSSttttrrrriiiinnnngggg.
  188.  
  189.               RWBoolean
  190.           ooooppppeeeerrrraaaattttoooorrrr!!!!() const;
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. RRRRWWWWCCCCSSSSuuuubbbbSSSSttttrrrriiiinnnngggg((((3333CCCC++++++++))))                                          RRRRWWWWCCCCSSSSuuuubbbbSSSSttttrrrriiiinnnngggg((((3333CCCC++++++++))))
  203.  
  204.  
  205.  
  206.      Returns TTTTRRRRUUUUEEEE if this is a null substring.
  207.  
  208.               size_t
  209.           ssssttttaaaarrrrtttt() const;
  210.  
  211.  
  212.      Returns the starting element of the RRRRWWWWCCCCSSSSuuuubbbbSSSSttttrrrriiiinnnngggg.
  213.  
  214.               void
  215.           ttttooooLLLLoooowwwweeeerrrr();
  216.  
  217.  
  218.      Changes all upper-case letters in self to lower-case.  Uses the standard
  219.      C library function ttttoooolllloooowwwweeeerrrr(((()))).
  220.  
  221.               void
  222.           ttttooooUUUUppppppppeeeerrrr();
  223.  
  224.  
  225.      Changes all lower-case letters in self to upper-case.  Uses the standard
  226.      C library function ttttoooouuuuppppppppeeeerrrr(((()))).
  227.  
  228. GGGGlllloooobbbbaaaallll LLLLooooggggiiiiccccaaaallll OOOOppppeeeerrrraaaattttoooorrrrssss
  229.               RWBoolean
  230.           ooooppppeeeerrrraaaattttoooorrrr========(const RWCSubString&, const RWCSubString&);
  231.           RWBoolean
  232.           ooooppppeeeerrrraaaattttoooorrrr========(const RWCString&,    const RWCSubString&);
  233.           RWBoolean
  234.           ooooppppeeeerrrraaaattttoooorrrr========(const RWCSubString&, const RWCString&   );
  235.           RWBoolean
  236.           ooooppppeeeerrrraaaattttoooorrrr========(const char*,         const RWCSubString&);
  237.           RWBoolean
  238.           ooooppppeeeerrrraaaattttoooorrrr========(const RWCSubString&, const char*        );
  239.  
  240.  
  241.      Returns TTTTRRRRUUUUEEEE if the substring is lexicographically equal to the character
  242.      string or RRRRWWWWCCCCSSSSttttrrrriiiinnnngggg argument.  Case sensitivity is eeeexxxxaaaacccctttt.
  243.  
  244.               RWBoolean
  245.           ooooppppeeeerrrraaaattttoooorrrr!!!!====(const RWCString&,    const RWCString&   );
  246.           RWBoolean
  247.           ooooppppeeeerrrraaaattttoooorrrr!!!!====(const RWCString&,    const RWCSubString&);
  248.           RWBoolean
  249.           ooooppppeeeerrrraaaattttoooorrrr!!!!====(const RWCSubString&, const RWCString&   );
  250.           RWBoolean
  251.           ooooppppeeeerrrraaaattttoooorrrr!!!!====(const char*,         const RWCString&   );
  252.           RWBoolean
  253.           ooooppppeeeerrrraaaattttoooorrrr!!!!====(const RWCString&,    const char*        );
  254.  
  255.  
  256.      Returns the negation of the respective ooooppppeeeerrrraaaattttoooorrrr========(((()))).
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.